﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
namespace WPFExcelReport
{
    public partial class VICC_WBBEW
    {

        public DataSet LOADBYEK(Dictionary<string, object> pm)
        {
            dwData = TBMain.NewRow();
            dwData["WBEWMANDANT"] = app.Mandant;
            dwData["WBEWAUFTYP"] = pm["AUFTYP"].ToString();
            dwData["WBEWAUFKRS"] = pm["KRS"].ToString();
            dwData["WBEWAUFLFD"] = pm["LFD"].ToString();
            dwData["WBEWAUFPOS"] = pm["POS"].ToString();
            SResult = QueryICC_WBBEW(dwData, 3);
            return SResult;
        }

        public void NEWEKWB(DataRow dwEKP, string TLO, string TLB, string TLP, double rlg, double rolls, double ACTRLFD)
        {
            string CART = dwEKP["PART"].ToString() + dwEKP["PVAR"].ToString();
            string CFARBE = dwEKP["PFARBE"].ToString();
            PM["WAKZ"] = dwEKP["EKPWAKZ"].ToString();
            PM["CART"] = CART;
            PM["CFARBE"] = CFARBE;
            PM["CBESCHICH"] = dwEKP["EKPBESCH"].ToString();
            PM["CDESS"] = dwEKP["EKPDESS"].ToString(); ;
            PM["CCOLORIT"] = dwEKP["EKPCOL"].ToString(); ;
            PM["ACTRLFD"] = ACTRLFD;
            PM["WBRWKRS"] = "  ";
            PM["LO"] = TLO;
            PM["ORDERNUM"] = dwEKP["EKPAUFKRS"].ToString() + dwEKP["EKPAUFLFD"].ToString() + dwEKP["EKPAUFPOS"].ToString() + "B";
            DataTable TBWBD = VWBD.NEWWB04(PM);

            RWAUF = "".PadRight(8);
            if (TBWBD == null)
                return;
            if (TBWBD.Rows.Count == 0)
                return;
            foreach (DataRow row in TBWBD.Rows)
            {
                RWAUF = row["WBRWKRS"].ToString() + row["WBRWLFD"].ToString();
            }


            PM["RWAUF"] = RWAUF;
            PM["LO"] = TLO;
            PM["LB"] = TLB;
            PM["LP"] = TLP;
            PM["ROLLS"] = rolls;
            PM["RLG"] = rlg;

            TBWB = VWB.NEWEKWB(PM);

            foreach (DataRow dwWB in TBWB.Rows)
            {
                dwWB["WBBAUFTYP"] = "B";
                dwWB["WBBAUFKRS"] = dwEKP["EKPAUFKRS"];
                dwWB["WBBAUFLFD"] = dwEKP["EKPAUFLFD"];
                dwWB["WBBAUFPOS"] = dwEKP["EKPAUFPOS"];
                NWBBEW(dwWB, "11", RUNID);
                /*
                WBEWMTR WBEWAUFTYP='B' AND  WBEWMANDANT=EKPMANDANT AND WBEWAUFKRS=EKPAUFKRS AND WBEWAUFLFD=EKPAUFLFD AND WBEWAUFPOS=EKPAUFPOS AND WBEWBS=11
                dwWB["WBBAUFTYP"] = " ";
                dwWB["WBBAUFKRS"] = "  ";
                dwWB["WBBAUFLFD"] = "000000";
                dwWB["WBBAUFPOS"] = "000";*/
            }
        }

        public void NEWABWB(DataRow dwABP, string TLO, string TLB, string TLP, double rlg, double rolls, double ACTRLFD)
        {
            string CART = dwABP["ABPART"].ToString() + dwABP["ABPVAR"].ToString();
            string CFARBE = dwABP["ABPFARBE"].ToString();
            PM["WAKZ"] = dwABP["ABPWAKZ"].ToString();
            PM["CART"] = CART;
            PM["CFARBE"] = CFARBE;
            PM["CBESCHICH"] = dwABP["ABPBESCHICH"].ToString(); ;
            PM["CDESS"] = dwABP["ABPDESS"].ToString(); ;
            PM["CCOLORIT"] = dwABP["ABPCOLORIT"].ToString(); ;
            PM["ACTRLFD"] = ACTRLFD;
            PM["WBRWKRS"] = "  ";
            PM["LO"] = TLO;
            PM["ORDERNUM"] = dwABP["ABPAUFKRS"].ToString() + dwABP["ABPAUFLFD"].ToString() + dwABP["ABPAUFPOS"].ToString() + "V";
            DataTable TBWBD = VWBD.NEWWB04(PM);
            RWAUF = "".PadRight(8);
            if (TBWBD == null)
                return;
            if (TBWBD.Rows.Count == 0)
                return;
            foreach (DataRow row in TBWBD.Rows)
            {
                RWAUF = row["WBRWKRS"].ToString() + row["WBRWLFD"].ToString();
            }


            PM["RWAUF"] = RWAUF;
            PM["LO"] = TLO;
            PM["LB"] = TLB;
            PM["LP"] = TLP;
            PM["ROLLS"] = rolls;
            PM["RLG"] = rlg;

            TBWB = VWB.NEWEKWB(PM);

            foreach (DataRow dwWB in TBWB.Rows)
            {
                dwWB["WBBAUFTYP"] = "B";
                dwWB["WBBAUFKRS"] = dwABP["ABPAUFKRS"];
                dwWB["WBBAUFLFD"] = dwABP["ABPAUFLFD"];
                dwWB["WBBAUFPOS"] = dwABP["ABPAUFPOS"];
                NWBBEW(dwWB, "11", RUNID);
                /*
                WBEWMTR WBEWAUFTYP='B' AND  WBEWMANDANT=EKPMANDANT AND WBEWAUFKRS=EKPAUFKRS AND WBEWAUFLFD=EKPAUFLFD AND WBEWAUFPOS=EKPAUFPOS AND WBEWBS=11
                dwWB["WBBAUFTYP"] = " ";
                dwWB["WBBAUFKRS"] = "  ";
                dwWB["WBBAUFLFD"] = "000000";
                dwWB["WBBAUFPOS"] = "000";*/
            }
        }
         
        public void ADDEKWB(double RLG)
        {
            if (TBWB == null)
                return;
            DataRow dwWB = null;
            var WBS = (from DataRow row in TBWB.AsEnumerable()
                       select row["WBBSTKNR"].ToString())
                     .Max();
            var QWB = from DataRow row in TBWB.AsEnumerable()
                      where row["WBBSTKNR"].ToString() == (string)WBS
                      select row;
            foreach (DataRow row in QWB)
            {
                dwWB = row;
            }
            if (dwWB == null)
                return;
            DataRow dwBW = null;
            RWAUF = dwWB["WBBRWKRS"].ToString() + dwWB["WBBRWLFD"].ToString();
            string stknr = dwWB["WBBSTKNR"].ToString();
            var query = from DataRow row in TBMain.AsEnumerable()
                        where row["WBEWSTKNR"].ToString() == dwWB["WBBSTKNR"].ToString()
                        select row;
            foreach (DataRow row in query)
            {
                dwBW = row;
            }
            if (dwBW == null)
                return;
            string prefix = RWAUF;
            if (RWAUF.Substring(0, 2) == "  ")
            {
                prefix = Convert.ToDouble(RWAUF).ToString();
            }

            PM["RWAUF"] = RWAUF;
            int WBLESTKNR = VWBD.GETMPOS(PM); ;
            DataRow dwNWB = dwWB.Table.NewRow();
            dwNWB.ItemArray = dwWB.ItemArray;
            dwNWB["WBBPOS"] = Helpers.Helper.Right("0000" + WBLESTKNR.ToString(), 4);
            dwNWB["WBBSTKNR"] = VWB.GETSTKNR(RWAUF, WBLESTKNR, WBLESTKNR);
            dwNWB["WBBAUFTYP"] = dwBW["WBEWAUFTYP"];
            dwNWB["WBBAUFKRS"] = dwBW["WBEWAUFKRS"];
            dwNWB["WBBAUFLFD"] = dwBW["WBEWAUFLFD"];
            dwNWB["WBBAUFPOS"] = dwBW["WBEWAUFPOS"];

            double BRT = System.Convert.ToDouble(dwWB["WBBSBRT"].ToString()) * 0.01 * 0.001;
            dwNWB["WBBSSTKLG"] = RLG * 1000;
            dwNWB["WBBSGEW"] = RLG * BRT * 100;
            dwNWB["WBBSBRT"] = BRT * 1000 * 100;

            dwNWB["WBBISTKLG"] = dwNWB["WBBSSTKLG"];
            dwNWB["WBBIGEW"] = dwNWB["WBBSGEW"];
            dwNWB["WBBIBRT"] = dwNWB["WBBSBRT"];
            dwNWB["WBBIBRTFV"] = dwNWB["WBBSBRT"];
            dwNWB["WBBIBRTFB"] = dwNWB["WBBSBRT"];
            DataRow dwWBM;

            var gapos = (from DataRow row in TBMain.AsEnumerable()
                         select System.Convert.ToDouble(row["WBEWLFDNR"].ToString()))
                      .Max();
            LFDNR = System.Convert.ToInt32((double)gapos) + 1;
            BELEG = dwBW["WBEWBELEG"].ToString();
            dwWBM = TBMain.NewRow();
            dwWBM.ItemArray = dwBW.ItemArray;
            VWBBEW.FIXDATA(dwWBM, dwNWB, "11", BELEG, LFDNR, null);
            TBMain.Rows.InsertAt(dwWBM, 0);
            dwNWB["WBBAUFTYP"] = " ";
            dwNWB["WBBAUFKRS"] = "  ";
            dwNWB["WBBAUFLFD"] = "000000";
            dwNWB["WBBAUFPOS"] = "000";
            dwWB.Table.Rows.InsertAt(dwNWB, 0);
        }

        public void RVZEROQTY()
        {
            if (TBWB == null)
                return;
            string stknr = "";

            filter = "WBBSSTKLG=0";
            rows = TBWB.Select(filter);
            foreach (DataRow row in rows)
            {
                stknr = row["WBBSTKNR"].ToString();
                row.Delete();
            }
            filter = "WBEWSTKNR='" + stknr + "'";
            rows = TBMain.Select(filter);

            foreach (DataRow row in rows)
            {
                row.Delete();
            }
            TBMain.AcceptChanges();

        }
        public void CHGEKWB(string stknr, double RLG)
        {
            if (TBWB == null)
                return;
            DataRow dwWB = null;

            var QWB = from DataRow row in TBWB.AsEnumerable()
                      where row["WBBSTKNR"].ToString() == stknr
                      select row;
            foreach (DataRow row in QWB)
            {
                dwWB = row;
            }
            if (dwWB == null)
                return;
            DataRow dwBW = null;

            var query = from DataRow row in TBMain.AsEnumerable()
                        where row["WBEWSTKNR"].ToString() == stknr
                        select row;
            foreach (DataRow row in query)
            {
                dwBW = row;
            }
            if (dwBW == null)
                return;

            double BRT = System.Convert.ToDouble(dwWB["WBBSBRT"].ToString()) * 0.01 * 0.001;
            dwWB["WBBSSTKLG"] = RLG * 1000;
            dwWB["WBBSGEW"] = RLG * BRT * 100;
            dwWB["WBBSBRT"] = BRT * 1000 * 100;

            dwWB["WBBISTKLG"] = dwWB["WBBSSTKLG"];
            dwWB["WBBIGEW"] = dwWB["WBBSGEW"];
            dwWB["WBBIBRT"] = dwWB["WBBSBRT"];
            dwWB["WBBIBRTFV"] = dwWB["WBBSBRT"];
            dwWB["WBBIBRTFB"] = dwWB["WBBSBRT"];

            dwWB["WBBAUFTYP"] = dwBW["WBEWAUFTYP"];
            dwWB["WBBAUFKRS"] = dwBW["WBEWAUFKRS"];
            dwWB["WBBAUFLFD"] = dwBW["WBEWAUFLFD"];
            dwWB["WBBAUFPOS"] = dwBW["WBEWAUFPOS"];

            LFDNR = System.Convert.ToInt32(dwBW["WBEWLFDNR"].ToString());
            BELEG = dwBW["WBEWBELEG"].ToString();
            VWBBEW.FIXDATA(dwBW, dwWB, "11", BELEG, LFDNR, null);
            dwWB["WBBAUFTYP"] = " ";
            dwWB["WBBAUFKRS"] = "  ";
            dwWB["WBBAUFLFD"] = "000000";
            dwWB["WBBAUFPOS"] = "000";
        }

        public void NWBBEW(DataRow dwWB, string WBEWBS, string _RUNID)
        {
            DataRow dwWBM;
            if (dwWB == null)
                return;
            VWBBEW.GETMOVMENT(dwWB, WBEWBS, ref _BELEG, ref LFDNR);
            dwWBM = TBMain.NewRow();
            SetUpNewRow(ref dwWBM);
            VWBBEW.FIXDATA(dwWBM, dwWB, WBEWBS, BELEG, LFDNR, null);
            //dwEKP
            TBMain.Rows.InsertAt(dwWBM, 0);
        }

        public void POSTBATCH(Dictionary<string, object> pm)
        {
            DataTable TBMOV = pm["TBWB14"] as DataTable;
            if (TBMOV == null)
                return;
            if (TBWB == null)
                return;
            string rwauf = pm["RWAUF"].ToString();

            dwData = VWB.TBMain.NewRow();
            dwData["WBBMANDANT"] = app.Mandant;
            dwData["WBBRWKRS"] = rwauf.Substring(0, 2);
            dwData["WBBRWLFD"] = rwauf.Substring(2, 6);
            VWB.DeleteWBBST(dwData, 2); //删除当前卡号下的所有行 

            foreach (DataRow dwWBM in TBMOV.Rows)
            {
                string stknr = dwWBM["WBEWSTKNR"].ToString();
                filter = "WBBSTKNR='" + stknr + "'";
                rows = TBWB.Select(filter);
                foreach (DataRow dwWB in rows)
                {
                    double RLG = 0.001 * System.Convert.ToDouble(dwWBM["WBEWMTR"].ToString());
                    double BRT = 0.001 * System.Convert.ToDouble(dwWBM["WBEWBRT"].ToString());
                    dwWB["WBBSSTKLG"] = RLG * 1000;
                    dwWB["WBBSGEW"] = RLG * BRT * 100;
                    dwWB["WBBIGEW"] = dwWB["WBBSGEW"];
                    dwWB["WBBISTKLG"] = dwWB["WBBSSTKLG"];
                }
            }
            filter = "WBEWRWKRS='" + rwauf.Substring(0, 2) + "' AND WBEWRWLFD='" + rwauf.Substring(2, 6) + "'";
            rows = TBMOV.Select(filter);
            foreach (DataRow dwWBM in rows)
            {
                // BATCHWB14(dwWBM); 不再插入ICC_WBBEW，此表已经用于月报
            }
            POSTCHG();

            dwData = TBMain.NewRow();
            dwData["WBEWMANDANT"] = app.Mandant;
            dwData["WBEWRWKRS"] = rwauf.Substring(0, 2);
            dwData["WBEWRWLFD"] = rwauf.Substring(2, 6);
            //DeleteICC_WBBEW(dwData, 2);//暂时保留，说明还没最终确认
            VWBBEW.DeleteWBBEW(dwData, 2);
            filter = "WBEWRWKRS='" + rwauf.Substring(0, 2) + "' AND WBEWRWLFD='" + rwauf.Substring(2, 6) + "'";
            rows = TBMOV.Select(filter);
            foreach (DataRow dwWBM in rows)
            {
                VWBBEW.BATCHWB14(dwWBM);
            }
            VWBBEW.POSTCHG();
            PM["TBWB"] = TBWB;
            PM["ORDERNUM"] = pm["ORDERNUM"];
            PM["AUFTYP"] = pm["AUFTYP"];
            PM["KRS"] = pm["KRS"];
            PM["LFD"] = pm["LFD"];
            PM["POS"] = pm["POS"];
            VWB.WB10BATCH(PM);
        }
    }
    public partial class VICC_WBBEW
    {
        VICC_STOCK _STK;
        public VICC_STOCK STK
        {
            get
            {
                if (_STK == null) _STK = new VICC_STOCK();
                return _STK;
            }
        }
        VICC_STOCKCHG _STKG;
        public VICC_STOCKCHG STKG
        {
            get
            {
                if (_STKG == null) _STKG = new VICC_STOCKCHG();
                return _STKG;
            }
        }
        VWBDAT _VWBD;
        public VWBDAT VWBD
        {
            get
            {
                if (_VWBD == null) _VWBD = new VWBDAT();
                return _VWBD;
            }
        }
        VWBBST _VWB;
        public VWBBST VWB
        {
            get
            {
                if (_VWB == null) _VWB = new VWBBST();
                return _VWB;
            }
        }
        VWBBEW _VWBBEW;
        public VWBBEW VWBBEW
        {
            get
            {
                if (_VWBBEW == null) _VWBBEW = new VWBBEW();
                return _VWBBEW;
            }
        }
        VEKPOS _VEKP;
        public VEKPOS VEKP
        {
            get
            {
                if (_VEKP == null) _VEKP = new VEKPOS();
                return _VEKP;
            }
        }
        private string _WBEWMTR; public string WBEWMTR { get { return _WBEWMTR; } set { _WBEWMTR = value; OnPropertyChanged("WBEWMTR", value); } } //lENGth 0
        public long LFDNR = 1;
        private string _BELEG = "0";
        public string BELEG { get { return _BELEG; } set { _BELEG = value; OnPropertyChanged("BELEG", value); } } //lENGth 2
        private DataTable _TBWB = null;
        public DataTable TBWB { get { return _TBWB; } set { _TBWB = value; OnPropertyChanged("TBWB", value); } } //lENGth 2

        private string _RWAUF = "0";
        public string RWAUF { get { return _RWAUF; } set { _RWAUF = value; OnPropertyChanged("RWAUF", value); } } //lENGth 2
        string LastOrder = "";

    }
    public partial class VICC_WBBEW
    {
        public double WBEWBUCHDAT { get { if (dwMaster == null) return 0.0; return Convert.ToDouble(dwMaster["WBEWBUCHDAT"].ToString()); } set { if (dwMaster == null) return; dwMaster["WBEWBUCHDAT"] = value; OnPropertyChanged("WBEWBUCHDAT", value); } } //lENGth 0
        public double WBEWBUCHUHR { get { if (dwMaster == null) return 0.0; return Convert.ToDouble(dwMaster["WBEWBUCHUHR"].ToString()); } set { if (dwMaster == null) return; dwMaster["WBEWBUCHUHR"] = value; OnPropertyChanged("WBEWBUCHUHR", value); } } //lENGth 0
        public string WBEWBUCHBEN { get { if (dwMaster == null) return ""; return dwMaster["WBEWBUCHBEN"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWBUCHBEN"] = value; OnPropertyChanged("WBEWBUCHBEN", value); } } //lENGth 8

        #region======ColumnSchema==========
        /*
                public string WBEWMANDANT { get { if (dwMaster == null) return ""; return dwMaster["WBEWMANDANT"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWMANDANT"] = value; OnPropertyChanged("WBEWMANDANT", value); } } //lENGth 2
                public double WBEWJJJJ { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WBEWJJJJ"].ToString()); } set { if (dwMaster == null) return; dwMaster["WBEWJJJJ"] = value; OnPropertyChanged("WBEWJJJJ", value); } } //lENGth 0
                public double WBEWBELEG { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WBEWBELEG"].ToString()); } set { if (dwMaster == null) return; dwMaster["WBEWBELEG"] = value; OnPropertyChanged("WBEWBELEG", value); } } //lENGth 0
                public double WBEWLFDNR { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WBEWLFDNR"].ToString()); } set { if (dwMaster == null) return; dwMaster["WBEWLFDNR"] = value; OnPropertyChanged("WBEWLFDNR", value); } } //lENGth 0
                public string WBEWKUNDNR { get { if (dwMaster == null) return ""; return dwMaster["WBEWKUNDNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWKUNDNR"] = value; OnPropertyChanged("WBEWKUNDNR", value); } } //lENGth 8
                public string WBEWWERK { get { if (dwMaster == null) return ""; return dwMaster["WBEWWERK"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWWERK"] = value; OnPropertyChanged("WBEWWERK", value); } } //lENGth 3
                public string WBEWABT { get { if (dwMaster == null) return ""; return dwMaster["WBEWABT"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWABT"] = value; OnPropertyChanged("WBEWABT", value); } } //lENGth 3
                public string WBEWWAKZ { get { if (dwMaster == null) return ""; return dwMaster["WBEWWAKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWWAKZ"] = value; OnPropertyChanged("WBEWWAKZ", value); } } //lENGth 1
                public string WBEWART { get { if (dwMaster == null) return ""; return dwMaster["WBEWART"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWART"] = value; OnPropertyChanged("WBEWART", value); } } //lENGth 20
                public string WBEWVAR { get { if (dwMaster == null) return ""; return dwMaster["WBEWVAR"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWVAR"] = value; OnPropertyChanged("WBEWVAR", value); } } //lENGth 2
                public string WBEWDESS { get { if (dwMaster == null) return ""; return dwMaster["WBEWDESS"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWDESS"] = value; OnPropertyChanged("WBEWDESS", value); } } //lENGth 10
                public string WBEWCOLORIT { get { if (dwMaster == null) return ""; return dwMaster["WBEWCOLORIT"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWCOLORIT"] = value; OnPropertyChanged("WBEWCOLORIT", value); } } //lENGth 10
                public string WBEWFARBE { get { if (dwMaster == null) return ""; return dwMaster["WBEWFARBE"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWFARBE"] = value; OnPropertyChanged("WBEWFARBE", value); } } //lENGth 10
                public string WBEWBESCHICH { get { if (dwMaster == null) return ""; return dwMaster["WBEWBESCHICH"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWBESCHICH"] = value; OnPropertyChanged("WBEWBESCHICH", value); } } //lENGth 10
                public string WBEWZUSTAND { get { if (dwMaster == null) return ""; return dwMaster["WBEWZUSTAND"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWZUSTAND"] = value; OnPropertyChanged("WBEWZUSTAND", value); } } //lENGth 4
                public string WBEWZENSUR { get { if (dwMaster == null) return ""; return dwMaster["WBEWZENSUR"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWZENSUR"] = value; OnPropertyChanged("WBEWZENSUR", value); } } //lENGth 1
                public string WBEWZENSURKZ { get { if (dwMaster == null) return ""; return dwMaster["WBEWZENSURKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWZENSURKZ"] = value; OnPropertyChanged("WBEWZENSURKZ", value); } } //lENGth 1
                public string WBEWTAX { get { if (dwMaster == null) return ""; return dwMaster["WBEWTAX"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWTAX"] = value; OnPropertyChanged("WBEWTAX", value); } } //lENGth 3
                public string WBEWAUFMSL { get { if (dwMaster == null) return ""; return dwMaster["WBEWAUFMSL"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWAUFMSL"] = value; OnPropertyChanged("WBEWAUFMSL", value); } } //lENGth 2
                public string WBEWPACKTYP { get { if (dwMaster == null) return ""; return dwMaster["WBEWPACKTYP"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWPACKTYP"] = value; OnPropertyChanged("WBEWPACKTYP", value); } } //lENGth 4
                public string WBEWLO { get { if (dwMaster == null) return ""; return dwMaster["WBEWLO"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWLO"] = value; OnPropertyChanged("WBEWLO", value); } } //lENGth 2
                public string WBEWLB { get { if (dwMaster == null) return ""; return dwMaster["WBEWLB"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWLB"] = value; OnPropertyChanged("WBEWLB", value); } } //lENGth 2
                public string WBEWLP { get { if (dwMaster == null) return ""; return dwMaster["WBEWLP"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWLP"] = value; OnPropertyChanged("WBEWLP", value); } } //lENGth 8
                public string WBEWAUFBKZ { get { if (dwMaster == null) return ""; return dwMaster["WBEWAUFBKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWAUFBKZ"] = value; OnPropertyChanged("WBEWAUFBKZ", value); } } //lENGth 1
                public string WBEWRWKRS { get { if (dwMaster == null) return ""; return dwMaster["WBEWRWKRS"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWRWKRS"] = value; OnPropertyChanged("WBEWRWKRS", value); } } //lENGth 2
                public string WBEWRWLFD { get { if (dwMaster == null) return ""; return dwMaster["WBEWRWLFD"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWRWLFD"] = value; OnPropertyChanged("WBEWRWLFD", value); } } //lENGth 6
                public string WBEWPOS { get { if (dwMaster == null) return ""; return dwMaster["WBEWPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWPOS"] = value; OnPropertyChanged("WBEWPOS", value); } } //lENGth 4
                public string WBEWSTKNR { get { if (dwMaster == null) return ""; return dwMaster["WBEWSTKNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWSTKNR"] = value; OnPropertyChanged("WBEWSTKNR", value); } } //lENGth 12
                public string WBEWTSTKNR { get { if (dwMaster == null) return ""; return dwMaster["WBEWTSTKNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWTSTKNR"] = value; OnPropertyChanged("WBEWTSTKNR", value); } } //lENGth 12
                public string WBEWGEBNR { get { if (dwMaster == null) return ""; return dwMaster["WBEWGEBNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWGEBNR"] = value; OnPropertyChanged("WBEWGEBNR", value); } } //lENGth 8
                public string WBEWGEBPOS { get { if (dwMaster == null) return ""; return dwMaster["WBEWGEBPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWGEBPOS"] = value; OnPropertyChanged("WBEWGEBPOS", value); } } //lENGth 3
                public string WBEWDPART { get { if (dwMaster == null) return ""; return dwMaster["WBEWDPART"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWDPART"] = value; OnPropertyChanged("WBEWDPART", value); } } //lENGth 11
                public double WBEWLAGE { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WBEWLAGE"].ToString()); } set { if (dwMaster == null) return; dwMaster["WBEWLAGE"] = value; OnPropertyChanged("WBEWLAGE", value); } } //lENGth 0
                public double WBEWBAHN { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WBEWBAHN"].ToString()); } set { if (dwMaster == null) return; dwMaster["WBEWBAHN"] = value; OnPropertyChanged("WBEWBAHN", value); } } //lENGth 0
                public string WBEWFSCHL { get { if (dwMaster == null) return ""; return dwMaster["WBEWFSCHL"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWFSCHL"] = value; OnPropertyChanged("WBEWFSCHL", value); } } //lENGth 3
                public string WBEWPACKNR { get { if (dwMaster == null) return ""; return dwMaster["WBEWPACKNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWPACKNR"] = value; OnPropertyChanged("WBEWPACKNR", value); } } //lENGth 4
                public string WBEWAUFTYP { get { if (dwMaster == null) return ""; return dwMaster["WBEWAUFTYP"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWAUFTYP"] = value; OnPropertyChanged("WBEWAUFTYP", value); } } //lENGth 1
                public string WBEWAUFKRS { get { if (dwMaster == null) return ""; return dwMaster["WBEWAUFKRS"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWAUFKRS"] = value; OnPropertyChanged("WBEWAUFKRS", value); } } //lENGth 2
                public string WBEWAUFLFD { get { if (dwMaster == null) return ""; return dwMaster["WBEWAUFLFD"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWAUFLFD"] = value; OnPropertyChanged("WBEWAUFLFD", value); } } //lENGth 6
                public string WBEWAUFPOS { get { if (dwMaster == null) return ""; return dwMaster["WBEWAUFPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWAUFPOS"] = value; OnPropertyChanged("WBEWAUFPOS", value); } } //lENGth 3
                public string WBEWAFOLGE { get { if (dwMaster == null) return ""; return dwMaster["WBEWAFOLGE"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWAFOLGE"] = value; OnPropertyChanged("WBEWAFOLGE", value); } } //lENGth 3
                public string WBEWTP { get { if (dwMaster == null) return ""; return dwMaster["WBEWTP"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWTP"] = value; OnPropertyChanged("WBEWTP", value); } } //lENGth 4
                public string WBEWAPOS { get { if (dwMaster == null) return ""; return dwMaster["WBEWAPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWAPOS"] = value; OnPropertyChanged("WBEWAPOS", value); } } //lENGth 4
                public string WBEWWDUPOS { get { if (dwMaster == null) return ""; return dwMaster["WBEWWDUPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWWDUPOS"] = value; OnPropertyChanged("WBEWWDUPOS", value); } } //lENGth 2
                public string WBEWMNRKRS { get { if (dwMaster == null) return ""; return dwMaster["WBEWMNRKRS"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWMNRKRS"] = value; OnPropertyChanged("WBEWMNRKRS", value); } } //lENGth 2
                public string WBEWMLFDNR { get { if (dwMaster == null) return ""; return dwMaster["WBEWMLFDNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWMLFDNR"] = value; OnPropertyChanged("WBEWMLFDNR", value); } } //lENGth 4
                public string WBEWMPOS { get { if (dwMaster == null) return ""; return dwMaster["WBEWMPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWMPOS"] = value; OnPropertyChanged("WBEWMPOS", value); } } //lENGth 2
                public string WBEWSCHICHT { get { if (dwMaster == null) return ""; return dwMaster["WBEWSCHICHT"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWSCHICHT"] = value; OnPropertyChanged("WBEWSCHICHT", value); } } //lENGth 1
                public string WBEWKSTKRS { get { if (dwMaster == null) return ""; return dwMaster["WBEWKSTKRS"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWKSTKRS"] = value; OnPropertyChanged("WBEWKSTKRS", value); } } //lENGth 2
                public string WBEWKST { get { if (dwMaster == null) return ""; return dwMaster["WBEWKST"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWKST"] = value; OnPropertyChanged("WBEWKST", value); } } //lENGth 4
                public string WBEWKOSTART { get { if (dwMaster == null) return ""; return dwMaster["WBEWKOSTART"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWKOSTART"] = value; OnPropertyChanged("WBEWKOSTART", value); } } //lENGth 6
                public string WBEWBS { get { if (dwMaster == null) return ""; return dwMaster["WBEWBS"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWBS"] = value; OnPropertyChanged("WBEWBS", value); } } //lENGth 2
                public double WBEWWERT { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WBEWWERT"].ToString()); } set { if (dwMaster == null) return; dwMaster["WBEWWERT"] = value; OnPropertyChanged("WBEWWERT", value); } } //lENGth 0
                public double WBEWWERTDAT { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WBEWWERTDAT"].ToString()); } set { if (dwMaster == null) return; dwMaster["WBEWWERTDAT"] = value; OnPropertyChanged("WBEWWERTDAT", value); } } //lENGth 0
                public string WBEWWEKORR { get { if (dwMaster == null) return ""; return dwMaster["WBEWWEKORR"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWWEKORR"] = value; OnPropertyChanged("WBEWWEKORR", value); } } //lENGth 2
                public double WBEWMTR { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WBEWMTR"].ToString()); } set { if (dwMaster == null) return; dwMaster["WBEWMTR"] = value; OnPropertyChanged("WBEWMTR", value); } } //lENGth 0
                public double WBEWGEW { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WBEWGEW"].ToString()); } set { if (dwMaster == null) return; dwMaster["WBEWGEW"] = value; OnPropertyChanged("WBEWGEW", value); } } //lENGth 0
                public double WBEWBRT { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WBEWBRT"].ToString()); } set { if (dwMaster == null) return; dwMaster["WBEWBRT"] = value; OnPropertyChanged("WBEWBRT", value); } } //lENGth 0
                public string WBEWFC { get { if (dwMaster == null) return ""; return dwMaster["WBEWFC"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWFC"] = value; OnPropertyChanged("WBEWFC", value); } } //lENGth 8
                public double WBEWKONDAT { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WBEWKONDAT"].ToString()); } set { if (dwMaster == null) return; dwMaster["WBEWKONDAT"] = value; OnPropertyChanged("WBEWKONDAT", value); } } //lENGth 0
                public string WBEWMATABR { get { if (dwMaster == null) return ""; return dwMaster["WBEWMATABR"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWMATABR"] = value; OnPropertyChanged("WBEWMATABR", value); } } //lENGth 1
                public string WBEWSTORKZ { get { if (dwMaster == null) return ""; return dwMaster["WBEWSTORKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWSTORKZ"] = value; OnPropertyChanged("WBEWSTORKZ", value); } } //lENGth 1
                public double WBEWINVBLG { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WBEWINVBLG"].ToString()); } set { if (dwMaster == null) return; dwMaster["WBEWINVBLG"] = value; OnPropertyChanged("WBEWINVBLG", value); } } //lENGth 0
                public string WBEWRENRG { get { if (dwMaster == null) return ""; return dwMaster["WBEWRENRG"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWRENRG"] = value; OnPropertyChanged("WBEWRENRG", value); } } //lENGth 11
                public string WBEWSTGRD { get { if (dwMaster == null) return ""; return dwMaster["WBEWSTGRD"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWSTGRD"] = value; OnPropertyChanged("WBEWSTGRD", value); } } //lENGth 2
                public string WBEWACTION { get { if (dwMaster == null) return ""; return dwMaster["WBEWACTION"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWACTION"] = value; OnPropertyChanged("WBEWACTION", value); } } //lENGth 2
                public string WBEWSAPKZ { get { if (dwMaster == null) return ""; return dwMaster["WBEWSAPKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWSAPKZ"] = value; OnPropertyChanged("WBEWSAPKZ", value); } } //lENGth 1
                public string WBEWFILLER { get { if (dwMaster == null) return ""; return dwMaster["WBEWFILLER"].ToString(); } set { if (dwMaster == null) return; dwMaster["WBEWFILLER"] = value; OnPropertyChanged("WBEWFILLER", value); } } //lENGth 48
       */
        #endregion
    }
}
